package com.example.fist.entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "notice", schema = "competition", catalog = "")
public class NoticeEntity {
    private int noId;
    private Integer comId;
    private String title;
    private String content;
    private String noType;
    private Date addTime;
    private Date modifiTime;
    private Date delTime;
    private String modifiName;
    private String state;
    private int isvisible;
    private String note;
    private String delName;

    @Id
    @Column(name = "no_id", nullable = false)
    public int getNoId() {
        return noId;
    }

    public void setNoId(int noId) {
        this.noId = noId;
    }

    @Basic
    @Column(name = "com_id", nullable = true)
    public Integer getComId() {
        return comId;
    }

    public void setComId(Integer comId) {
        this.comId = comId;
    }

    @Basic
    @Column(name = "title", nullable = false, length = 20)
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "content", nullable = false, length = -1)
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "no_type", nullable = false, length = 20)
    public String getNoType() {
        return noType;
    }

    public void setNoType(String noType) {
        this.noType = noType;
    }

    @Basic
    @Column(name = "add_time", nullable = false)
    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    @Basic
    @Column(name = "modifi_time", nullable = false)
    public Date getModifiTime() {
        return modifiTime;
    }

    public void setModifiTime(Date modifiTime) {
        this.modifiTime = modifiTime;
    }

    @Basic
    @Column(name = "del_time", nullable = false)
    public Date getDelTime() {
        return delTime;
    }

    public void setDelTime(Date delTime) {
        this.delTime = delTime;
    }

    @Basic
    @Column(name = "modifi_name", nullable = false, length = 10)
    public String getModifiName() {
        return modifiName;
    }

    public void setModifiName(String modifiName) {
        this.modifiName = modifiName;
    }

    @Basic
    @Column(name = "state", nullable = false, length = 10)
    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    @Basic
    @Column(name = "isvisible", nullable = false)
    public int getIsvisible() {
        return isvisible;
    }

    public void setIsvisible(int isvisible) {
        this.isvisible = isvisible;
    }

    @Basic
    @Column(name = "note", nullable = false, length = -1)
    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    @Basic
    @Column(name = "del_name", nullable = true, length = 255)
    public String getDelName() {
        return delName;
    }

    public void setDelName(String delName) {
        this.delName = delName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        NoticeEntity that = (NoticeEntity) o;
        return noId == that.noId &&
                isvisible == that.isvisible &&
                Objects.equals(comId, that.comId) &&
                Objects.equals(title, that.title) &&
                Objects.equals(content, that.content) &&
                Objects.equals(noType, that.noType) &&
                Objects.equals(addTime, that.addTime) &&
                Objects.equals(modifiTime, that.modifiTime) &&
                Objects.equals(delTime, that.delTime) &&
                Objects.equals(modifiName, that.modifiName) &&
                Objects.equals(state, that.state) &&
                Objects.equals(note, that.note) &&
                Objects.equals(delName, that.delName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(noId, comId, title, content, noType, addTime, modifiTime, delTime, modifiName, state, isvisible, note, delName);
    }
}
